<MDXHeader
  title="Pagination"
  description="Pagination with page navigation, next and previous links."
  docs="https://kobalte.dev/docs/core/components/pagination"
/>

<ComponentPreview name="pagination-demo" />

## Installation

<Tabs defaultValue="cli">

<TabsList>
  <TabsTrigger value="cli">CLI</TabsTrigger>
  <TabsTrigger value="manual">Manual</TabsTrigger>
</TabsList>

<TabsContent value="cli">

```bash
npx solidui-cli@latest add pagination
```

</TabsContent>

<TabsContent value="manual">
<Steps>

<Step>Install the following dependencies: </Step>

```bash
npm install @kobalte/core
```

<Step>Copy and paste the following code into your project: </Step>

<ComponentSource name="pagination" />

</Steps>
</TabsContent>

</Tabs>

## Usage

```tsx
import {
  Pagination,
  PaginationEllipsis,
  PaginationItem,
  PaginationItems,
  PaginationNext,
  PaginationPrevious
} from "~/components/ui/pagination"
```

```tsx
<Pagination
  itemComponent={(props) => <PaginationItem page={props.page}>{props.page}</PaginationItem>}
  ellipsisComponent={() => <PaginationEllipsis />}
>
  <PaginationPrevious />
  <PaginationItems />
  <PaginationNext />
</Pagination>
```
